project(dichatcore)

include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/lib ${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/core)
SET( CORE_SRCS
    main.cpp
    coreserver.cpp
    Identity.cpp
    xmppconnection.cpp
    coremain.cpp
    corexmlparser.cpp
    corexmlgenerator.cpp
    corecontroller.cpp
    databaseconnection.cpp
    corexmlhandler.cpp
    constants.h
)


SET( CORE_MOC_HDRS
       coreserver.h 
       corexmlhandler.h
       xmppconnection.h
       Identity.h
       corexmlparser.h
       corexmlgenerator.h
       corecontroller.h
       databaseconnection.h
)

  ## and finally an resource file
  #SET( SAMPLE_RCS
  #     ./src/rc/sample.qrc
  #)
  
  # enable warnings
  ADD_DEFINITIONS( -Wall )
  
  # by default only QtCore and QtGui modules are enabled
  # other modules must be enabled like this:
  SET( QT_USE_QTSQL TRUE )   
  SET( QT_USE_QTXML TRUE )
  SET( QT_USE_QTNETWORK TRUE )
  SET( QT_DONT_USE_QTGUI TRUE)
  
  FIND_PACKAGE( Qt4 REQUIRED )
  
  INCLUDE( ${QT_USE_FILE} )
  
  #QT4_ADD_RESOURCES( CORE_RC_SRCS ${CORE_RCS} )
  
  
  QT4_WRAP_CPP( CORE_MOC_SRCS ${CORE_MOC_HDRS} )

  
  ADD_EXECUTABLE( dichatcore ${CORE_SRCS} ${CORE_MOC_SRCS} )
  TARGET_LINK_LIBRARIES( dichatcore ${QT_LIBRARIES} ${CMAKE_BINARY_DIR}/src/lib/qxmpp/libQXmppClient.a ${CMAKE_BINARY_DIR}/src/common/libDichatCommon.a)
